import { createApp } from 'vue'
import App from './App.vue'
import { constantRoutes } from './router'
import store from './store'
import { createRouter, createWebHashHistory } from 'vue-router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '@/styles/index.scss' // global css
// 引用element字体图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const router = createRouter({
  // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
  history: createWebHashHistory(),
  routes: constantRoutes
})


const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 设置icon
import installIcon from './plugins/icon.js'
app.use(ElementPlus)
app.use(router)
app.use(store)
app.use(installIcon)
app.mount('#app')